<template>
  <div>
  <el-button type="primary" style="margin-bottom: 30px;" @click="add">新增诉状</el-button>
  <el-table
    :data="tableData"
    border
    style="width: 100%">
    <el-table-column
      fixed
      prop="id"
      label="id"
      width="150">
    </el-table-column>
    <el-table-column
      prop="lawyer"
      label="委托代理人"
    >
    </el-table-column>
    <el-table-column
      prop="real_name"
      label="原告"
    >
    </el-table-column>
    <el-table-column
      prop="defendant"
      label="被告"
    >
    </el-table-column>
    <el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template slot-scope="scope">
        <el-button @click="getLook(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
    </el-table-column>
  </el-table>
  </div>
</template>

<script>
	import { GetListInfo, GetDetailInfo } from "../../common/js/api";
export default {
  methods: {
    getList() {
      GetListInfo({lawyer: "",bm_reason: ""}).then(res => {
        if(res.data.code === 0) {
          this.tableData = res.data.data;
        }
      })
    },
    add() {
      this.$router.push({ path: '/addPlaint' });
    },
    getLook(obj) {
      GetListInfo({id: obj.id}).then(res => {
          if(res.data.code === 0) {
            console.log(res)
          }
      })
    }
  },

  data() {
    return {
      tableData: [
        ]
    };
  },
  created() {this.getList()
  }
};
</script>
